from turtle import *


def DR(h):
    pendown()
    setheading(90)
    forward(h)
    setheading(0)
    forward(20)
    setheading(270)
    forward(h)
    penup()

#set window
setup(440, 440)
penup()
#----------#
#draw line
setx(-220)
sety(0)
pendown()
setx(220)
penup()
#----------#
#draw rect
x = -110
for h in [100, 120, 140, 160, 180, 200]:
    setx(x)
    DR(h)
    x += (20 + 20)
#----------#
#done
hideturtle()
done()
